package com.yanyeori.nacosfeign.controller;

import com.yanyeori.framework.core.model.WebResponse;
import com.yanyeori.nacosfeign.client.FeignBClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author chenkuan
 * @version v1.0
 * @desc 测试接口
 * @date 20/8/07 10:29
 */
@RestController
public class TestController {
    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private FeignBClient feignBClient;

    @PostMapping("/testController/test")
    public WebResponse test() {
        //调用远程服务nacos-feign-b-business
        WebResponse response = feignBClient.rest("feign sentinel调用b参数");
        logger.info("远程服务返回：{}", response);
        return response;
    }
}
